package com.crm.jpaandthymeleaf.web.controller;

import com.crm.jpaandthymeleaf.entity.SysRole;
import com.crm.jpaandthymeleaf.repository.SysRoleRepository;
import com.crm.jpaandthymeleaf.service.ISysRoleService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author 周敬
 * @version 1.0
 * @packageName com.crm.jpaandthymeleaf.web.controller
 * @fileName SysRoleController
 * @createTime 2021/12/17-18:56-星期五
 * @lastModify 2021/12/17-18:56-星期五
 */
@Controller
@RequestMapping("/role")
public class SysRoleController {
    @Resource
    private ISysRoleService sysRoleService;

    @GetMapping("/json")
    @ResponseBody
    public List<SysRole> findAllRoles(){
        return sysRoleService.findAllSysRole();
    }
}
